package com.asset.bill.controller;

import com.asset.bill.biz.IBillBiz;
import com.asset.bill.form.BillForm;
import com.asset.bill.form.BillQueryForm;
import com.asset.common.pageform.PageForm;
import com.asset.common.result.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userbill")
public class BillController {

    @Autowired
    private IBillBiz userBillBiz;

    @RequestMapping(value = "/billlist.json", method = RequestMethod.POST)
    public PageForm<BillForm> billList(@RequestBody BillQueryForm queyForm){
        return userBillBiz.getBillList(queyForm);
    }

    @RequestMapping(value = "updatebill.json", method = RequestMethod.POST)
    public ResultMsg updateBill(@RequestBody BillForm billForm){
        return userBillBiz.updateBill(billForm);
    }

    @RequestMapping(value = "delete.json",method = RequestMethod.POST)
    public ResultMsg deleteById(Long billId){
        return userBillBiz.deleteById(billId);
    }
}
